Optimal. Leaf size=170 \[ -\frac {d^2 e^{-4 e-4 f x}}{128 a^2 f^3}+\frac {d^2 e^{-2 e-2 f x}}{8 a^2 f^3}-\frac {d e^{-4 e-4 f x} (c+d x)}{32 a^2 f^2}+\frac {d e^{-2 e-2 f x} (c+d x)}{4 a^2 f^2}-\frac {e^{-4 e-4 f x} (c+d x)^2}{16 a^2 f}+\frac {e^{-2 e-2 f x} (c+d x)^2}{4 a^2 f}+\frac {(c+d x)^3}{12 a^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 170, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 3, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3810, 2207,
2225} \begin {gather*} -\frac {d (c+d x) e^{-4 e-4 f x}}{32 a^2 f^2}+\frac {d (c+d x) e^{-2 e-2 f x}}{4 a^2 f^2}-\frac {(c+d x)^2 e^{-4 e-4 f x}}{16 a^2 f}+\frac {(c+d x)^2 e^{-2 e-2 f x}}{4 a^2 f}+\frac {(c+d x)^3}{12 a^2 d}-\frac {d^2 e^{-4 e-4 f x}}{128 a^2 f^3}+\frac {d^2 e^{-2 e-2 f x}}{8 a^2 f^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2207
Rule 2225
Rule 3810
Rubi steps
\begin {align*} \int \frac {(c+d x)^2}{(a+a \coth (e+f x))^2} \, dx &=\int \left (\frac {(c+d x)^2}{4 a^2}+\frac {e^{-4 e-4 f x} (c+d x)^2}{4 a^2}-\frac {e^{-2 e-2 f x} (c+d x)^2}{2 a^2}\right ) \, dx\\ &=\frac {(c+d x)^3}{12 a^2 d}+\frac {\int e^{-4 e-4 f x} (c+d x)^2 \, dx}{4 a^2}-\frac {\int e^{-2 e-2 f x} (c+d x)^2 \, dx}{2 a^2}\\ &=-\frac {e^{-4 e-4 f x} (c+d x)^2}{16 a^2 f}+\frac {e^{-2 e-2 f x} (c+d x)^2}{4 a^2 f}+\frac {(c+d x)^3}{12 a^2 d}+\frac {d \int e^{-4 e-4 f x} (c+d x) \, dx}{8 a^2 f}-\frac {d \int e^{-2 e-2 f x} (c+d x) \, dx}{2 a^2 f}\\ &=-\frac {d e^{-4 e-4 f x} (c+d x)}{32 a^2 f^2}+\frac {d e^{-2 e-2 f x} (c+d x)}{4 a^2 f^2}-\frac {e^{-4 e-4 f x} (c+d x)^2}{16 a^2 f}+\frac {e^{-2 e-2 f x} (c+d x)^2}{4 a^2 f}+\frac {(c+d x)^3}{12 a^2 d}+\frac {d^2 \int e^{-4 e-4 f x} \, dx}{32 a^2 f^2}-\frac {d^2 \int e^{-2 e-2 f x} \, dx}{4 a^2 f^2}\\ &=-\frac {d^2 e^{-4 e-4 f x}}{128 a^2 f^3}+\frac {d^2 e^{-2 e-2 f x}}{8 a^2 f^3}-\frac {d e^{-4 e-4 f x} (c+d x)}{32 a^2 f^2}+\frac {d e^{-2 e-2 f x} (c+d x)}{4 a^2 f^2}-\frac {e^{-4 e-4 f x} (c+d x)^2}{16 a^2 f}+\frac {e^{-2 e-2 f x} (c+d x)^2}{4 a^2 f}+\frac {(c+d x)^3}{12 a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.59, size = 207, normalized size = 1.22 \begin {gather*} \frac {\text {csch}^2(e+f x) \left (48 \left (2 c^2 f^2+2 c d f (1+2 f x)+d^2 \left (1+2 f x+2 f^2 x^2\right )\right )+\left (24 c^2 f^2 (-1+4 f x)+12 c d f \left (-1-4 f x+8 f^2 x^2\right )+d^2 \left (-3-12 f x-24 f^2 x^2+32 f^3 x^3\right )\right ) \cosh (2 (e+f x))+\left (24 c^2 f^2 (1+4 f x)+12 c d f \left (1+4 f x+8 f^2 x^2\right )+d^2 \left (3+12 f x+24 f^2 x^2+32 f^3 x^3\right )\right ) \sinh (2 (e+f x))\right )}{384 a^2 f^3 (1+\coth (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.94, size = 163, normalized size = 0.96
method | result | size |
risch | \(\frac {d^{2} x^{3}}{12 a^{2}}+\frac {d c \,x^{2}}{4 a^{2}}+\frac {c^{2} x}{4 a^{2}}+\frac {c^{3}}{12 a^{2} d}+\frac {\left (2 d^{2} x^{2} f^{2}+4 c d \,f^{2} x +2 c^{2} f^{2}+2 d^{2} f x +2 c d f +d^{2}\right ) {\mathrm e}^{-2 f x -2 e}}{8 a^{2} f^{3}}-\frac {\left (8 d^{2} x^{2} f^{2}+16 c d \,f^{2} x +8 c^{2} f^{2}+4 d^{2} f x +4 c d f +d^{2}\right ) {\mathrm e}^{-4 f x -4 e}}{128 a^{2} f^{3}}\) | \(163\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.46, size = 203, normalized size = 1.19 \begin {gather*} \frac {1}{16} \, c^{2} {\left (\frac {4 \, {\left (f x + e\right )}}{a^{2} f} + \frac {4 \, e^{\left (-2 \, f x - 2 \, e\right )} - e^{\left (-4 \, f x - 4 \, e\right )}}{a^{2} f}\right )} + \frac {{\left (8 \, f^{2} x^{2} e^{\left (4 \, e\right )} + 8 \, {\left (2 \, f x e^{\left (2 \, e\right )} + e^{\left (2 \, e\right )}\right )} e^{\left (-2 \, f x\right )} - {\left (4 \, f x + 1\right )} e^{\left (-4 \, f x\right )}\right )} c d e^{\left (-4 \, e\right )}}{32 \, a^{2} f^{2}} + \frac {{\left (32 \, f^{3} x^{3} e^{\left (4 \, e\right )} + 48 \, {\left (2 \, f^{2} x^{2} e^{\left (2 \, e\right )} + 2 \, f x e^{\left (2 \, e\right )} + e^{\left (2 \, e\right )}\right )} e^{\left (-2 \, f x\right )} - 3 \, {\left (8 \, f^{2} x^{2} + 4 \, f x + 1\right )} e^{\left (-4 \, f x\right )}\right )} d^{2} e^{\left (-4 \, e\right )}}{384 \, a^{2} f^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 383 vs.
\(2 (156) = 312\).
time = 0.37, size = 383, normalized size = 2.25 \begin {gather*} \frac {96 \, d^{2} f^{2} x^{2} + 96 \, c^{2} f^{2} + 96 \, c d f + {\left (32 \, d^{2} f^{3} x^{3} - 24 \, c^{2} f^{2} - 12 \, c d f + 24 \, {\left (4 \, c d f^{3} - d^{2} f^{2}\right )} x^{2} - 3 \, d^{2} + 12 \, {\left (8 \, c^{2} f^{3} - 4 \, c d f^{2} - d^{2} f\right )} x\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )^{2} + 2 \, {\left (32 \, d^{2} f^{3} x^{3} + 24 \, c^{2} f^{2} + 12 \, c d f + 24 \, {\left (4 \, c d f^{3} + d^{2} f^{2}\right )} x^{2} + 3 \, d^{2} + 12 \, {\left (8 \, c^{2} f^{3} + 4 \, c d f^{2} + d^{2} f\right )} x\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + {\left (32 \, d^{2} f^{3} x^{3} - 24 \, c^{2} f^{2} - 12 \, c d f + 24 \, {\left (4 \, c d f^{3} - d^{2} f^{2}\right )} x^{2} - 3 \, d^{2} + 12 \, {\left (8 \, c^{2} f^{3} - 4 \, c d f^{2} - d^{2} f\right )} x\right )} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )^{2} + 48 \, d^{2} + 96 \, {\left (2 \, c d f^{2} + d^{2} f\right )} x}{384 \, {\left (a^{2} f^{3} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )^{2} + 2 \, a^{2} f^{3} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) + a^{2} f^{3} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 1353 vs.
\(2 (165) = 330\).
time = 0.98, size = 1353, normalized size = 7.96 \begin {gather*} \begin {cases} \frac {24 c^{2} f^{3} x \tanh ^{2}{\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {48 c^{2} f^{3} x \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {24 c^{2} f^{3} x}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {72 c^{2} f^{2} \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {48 c^{2} f^{2}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {24 c d f^{3} x^{2} \tanh ^{2}{\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {48 c d f^{3} x^{2} \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {24 c d f^{3} x^{2}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} - \frac {60 c d f^{2} x \tanh ^{2}{\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {24 c d f^{2} x \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {36 c d f^{2} x}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {60 c d f \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {48 c d f}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {8 d^{2} f^{3} x^{3} \tanh ^{2}{\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {16 d^{2} f^{3} x^{3} \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {8 d^{2} f^{3} x^{3}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} - \frac {30 d^{2} f^{2} x^{2} \tanh ^{2}{\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {12 d^{2} f^{2} x^{2} \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {18 d^{2} f^{2} x^{2}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} - \frac {27 d^{2} f x \tanh ^{2}{\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {6 d^{2} f x \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {21 d^{2} f x}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {27 d^{2} \tanh {\left (e + f x \right )}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} + \frac {24 d^{2}}{96 a^{2} f^{3} \tanh ^{2}{\left (e + f x \right )} + 192 a^{2} f^{3} \tanh {\left (e + f x \right )} + 96 a^{2} f^{3}} & \text {for}\: f \neq 0 \\\frac {c^{2} x + c d x^{2} + \frac {d^{2} x^{3}}{3}}{\left (a \coth {\left (e \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 217, normalized size = 1.28 \begin {gather*} \frac {{\left (32 \, d^{2} f^{3} x^{3} e^{\left (4 \, f x + 4 \, e\right )} + 96 \, c d f^{3} x^{2} e^{\left (4 \, f x + 4 \, e\right )} + 96 \, c^{2} f^{3} x e^{\left (4 \, f x + 4 \, e\right )} + 96 \, d^{2} f^{2} x^{2} e^{\left (2 \, f x + 2 \, e\right )} - 24 \, d^{2} f^{2} x^{2} + 192 \, c d f^{2} x e^{\left (2 \, f x + 2 \, e\right )} - 48 \, c d f^{2} x + 96 \, c^{2} f^{2} e^{\left (2 \, f x + 2 \, e\right )} + 96 \, d^{2} f x e^{\left (2 \, f x + 2 \, e\right )} - 24 \, c^{2} f^{2} - 12 \, d^{2} f x + 96 \, c d f e^{\left (2 \, f x + 2 \, e\right )} - 12 \, c d f + 48 \, d^{2} e^{\left (2 \, f x + 2 \, e\right )} - 3 \, d^{2}\right )} e^{\left (-4 \, f x - 4 \, e\right )}}{384 \, a^{2} f^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.28, size = 164, normalized size = 0.96 \begin {gather*} {\mathrm {e}}^{-2\,e-2\,f\,x}\,\left (\frac {2\,c^2\,f^2+2\,c\,d\,f+d^2}{8\,a^2\,f^3}+\frac {d^2\,x^2}{4\,a^2\,f}+\frac {d\,x\,\left (d+2\,c\,f\right )}{4\,a^2\,f^2}\right )-{\mathrm {e}}^{-4\,e-4\,f\,x}\,\left (\frac {8\,c^2\,f^2+4\,c\,d\,f+d^2}{128\,a^2\,f^3}+\frac {d^2\,x^2}{16\,a^2\,f}+\frac {d\,x\,\left (d+4\,c\,f\right )}{32\,a^2\,f^2}\right )+\frac {c^2\,x}{4\,a^2}+\frac {d^2\,x^3}{12\,a^2}+\frac {c\,d\,x^2}{4\,a^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________